UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uPcRBTpIDcd2V25SAcQBuPDRksyNE0Zl1F6/H11AQR0=' 
WHERE 
  key_id = '3ecb46720f29e444927b58e22f024301c6da84ae3da43f45112d5df3dc774d47' 
  AND (
    token = 'uPcRBTpIDcd2V25SAcQBuPDRksyNE0Zl1F6/H11AQR0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038