UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DNHZ3iQBbYA3fAAOWXWw4iqVqwBKWLBi/hN8C/9QKME=' 
WHERE 
  key_id = 'acab6e193c64c4119a1936a2f7a4e90da48f408e78b867f5b909c234519d20b9' 
  AND (
    token = 'DNHZ3iQBbYA3fAAOWXWw4iqVqwBKWLBi/hN8C/9QKME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039