UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AIXai2n4zg/SCIW7N9jG1fW0CL/El1CW++25M00NMXE=' 
WHERE 
  key_id = '4709a9a4019d8fb6e79c90f31610b91cb2f1c17b573ddb579a19125cb85b84bd' 
  AND (
    token = 'AIXai2n4zg/SCIW7N9jG1fW0CL/El1CW++25M00NMXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022