UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'asDkADQhpJsweagk7KMmrSUgGlTh6TNvzpUwKb1mQ6M=' 
WHERE 
  key_id = '1605d24d9d436ae3df1cd29b9153d4d49840c7e35bd9d51804b8931ddf2b89a3' 
  AND (
    token = 'asDkADQhpJsweagk7KMmrSUgGlTh6TNvzpUwKb1mQ6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020