UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xyRJRbkNIPR/NoU4bsKnugYhtzxZqKXOUZPPo7EKazw=' 
WHERE 
  key_id = '1feade6448a6051429e9fee197d4ac1cb8a2a83819a2fae50c7e389630934456' 
  AND (
    token = 'xyRJRbkNIPR/NoU4bsKnugYhtzxZqKXOUZPPo7EKazw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027