UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bQl5FU3YeOhKtArQZaU6krVCtCn5kcNSkNfnT9QLDjw=' 
WHERE 
  key_id = 'bf883ca9aae580934684d10ca899af11251763035cbf4ab7f5912e6c68111bb1' 
  AND (
    token = 'bQl5FU3YeOhKtArQZaU6krVCtCn5kcNSkNfnT9QLDjw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024