UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eaq79NewuupO1tfV4Yqy6f/FAajDLpeYZ5qHt+g5c6A=' 
WHERE 
  key_id = '7dbf3cd66016554bbabc95f34987f3c331b5269a2eb133c5e68d36c9032ee4ad' 
  AND (
    token = 'eaq79NewuupO1tfV4Yqy6f/FAajDLpeYZ5qHt+g5c6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042