UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GvY399FylSbSUhEzmBKztHi4NGj7g5YsJFlgSAEot/w=' 
WHERE 
  key_id = '849a482a59c0b2c4ae802bd130c70dbf2cb5303f773b68dffedd66bf760b5711' 
  AND (
    token = 'GvY399FylSbSUhEzmBKztHi4NGj7g5YsJFlgSAEot/w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060