UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6TLRq/G9OMJCx//hjcuDFokiQf8NTjnME5KyLAQFUVw=' 
WHERE 
  key_id = '6d1d708b9625cbf6569a81bc6ed215c175359fd8c9fe81c31cf8b11ab81deccd' 
  AND (
    token = '6TLRq/G9OMJCx//hjcuDFokiQf8NTjnME5KyLAQFUVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038