UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vRO6saQaluN/q+ZNSzsMHvNJAbyaJ2E2eyfsdbZBNuE=' 
WHERE 
  key_id = 'c2c52034207c4130c41a67cd3df1fb1e61cf6860ad4d7b0687375ae634c5533f' 
  AND (
    token = 'vRO6saQaluN/q+ZNSzsMHvNJAbyaJ2E2eyfsdbZBNuE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020