UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WoMlmnHRvpfn2DJMfSeo8P/+ACQPIR65bRiEIQ4Zc10=' 
WHERE 
  key_id = 'ee9d0060a60a144d7ba349a1137d2689444b3350f906611fc41493f3892555b4' 
  AND (
    token = 'WoMlmnHRvpfn2DJMfSeo8P/+ACQPIR65bRiEIQ4Zc10=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029