UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'heU2eEMN4dyAGAuD2sAqd3HwhEdO4J6pdQpp/loG2Z0=' 
WHERE 
  key_id = 'd94f9fa047d1e67db4cf381d54173b707189621f2d2a239ab22bbac2c66511eb' 
  AND (
    token = 'heU2eEMN4dyAGAuD2sAqd3HwhEdO4J6pdQpp/loG2Z0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040