UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NiSg+lfPHruqLDtH/RfKoZFKW+f5QP8Vjl6jpDJvLk8=' 
WHERE 
  key_id = '1fd65ce74d93b2bcb6e6622fcb32d1c88830c281014f77fb039fa4c54659a2fc' 
  AND (
    token = 'NiSg+lfPHruqLDtH/RfKoZFKW+f5QP8Vjl6jpDJvLk8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049