UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+ZCyekW6aPsmuzpIJRtUNp75MzoFaEfxzQVA+6mz+rw=' 
WHERE 
  key_id = '7b18d5ab53771b79dd9d764db6e48b7cb6eb5d23adcdac61e7d4c2984d31a7e0' 
  AND (
    token = '+ZCyekW6aPsmuzpIJRtUNp75MzoFaEfxzQVA+6mz+rw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070