UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3l4/7uakZmyfQ+a4f4ZdQTcvAgiaAJoRk1++sADFYJg=' 
WHERE 
  key_id = 'e5665560f5b0bdd304754ebfba2a534787505d05f74f2fda81bb4475ba2ec826' 
  AND (
    token = '3l4/7uakZmyfQ+a4f4ZdQTcvAgiaAJoRk1++sADFYJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029