UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cFC53Zz4+pF58OITnt+j+4ZLGy18nE/VxKjlMlxLnJA=' 
WHERE 
  key_id = 'b3cc48403e71d13f60f68a058f425acf983bfebdf87f75cc0ccac850f873f492' 
  AND (
    token = 'cFC53Zz4+pF58OITnt+j+4ZLGy18nE/VxKjlMlxLnJA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039