UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WWDAC9aL9Zjd/sEPjoE21x4yKN9GFExvkrUJVs2NxVU=' 
WHERE 
  key_id = 'c18e8301915d82c862896608adb91ebe0d3cc3b72e69697bb770d1b1c7f044ac' 
  AND (
    token = 'WWDAC9aL9Zjd/sEPjoE21x4yKN9GFExvkrUJVs2NxVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038