UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cL0uM0LBiJiz3B46eYQC0y/oGS3Q5Alf615TQSt6vOo=' 
WHERE 
  key_id = '185f84b382cd20211af59fbce2c0745f5d669a2a68e24f463a8fcf0b981b84b9' 
  AND (
    token = 'cL0uM0LBiJiz3B46eYQC0y/oGS3Q5Alf615TQSt6vOo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030