UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LOOtCvx2IIkCgDx9Kh/pEwIOOrjI56qCekzUSAyIzw4=' 
WHERE 
  key_id = '2dfd4fda4a9dabfbd6a42986b07b870e2b87dad6d6804658f2e401b5b3940662' 
  AND (
    token = 'LOOtCvx2IIkCgDx9Kh/pEwIOOrjI56qCekzUSAyIzw4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025