UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G7bQTk3QdNld/KjX58xJlNqbtQ+Ofr7OCyFiXS0eUEc=' 
WHERE 
  key_id = 'd663366739fc5303eb85ffd4dc8a9ce270ec93b8daedda569f4a73ca2e22079d' 
  AND (
    token = 'G7bQTk3QdNld/KjX58xJlNqbtQ+Ofr7OCyFiXS0eUEc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020