UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bXfabimMwGsaiOrVaBfI7EitAaRAXTfR3uRPhw5CvcY=' 
WHERE 
  key_id = '538a7ebf1179edfa7029951c8ebcc5d1be3889149aa182613d6cd447d2ae31db' 
  AND (
    token = 'bXfabimMwGsaiOrVaBfI7EitAaRAXTfR3uRPhw5CvcY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025