UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'noYzIw5y4eiSURpARiPLp/h93/Uzbi+32s5GXQsbz3k=' 
WHERE 
  key_id = 'a15afa7efd76338de369cbfa53dbace802c4aba83996ca7f56c6876a4a398caf' 
  AND (
    token = 'noYzIw5y4eiSURpARiPLp/h93/Uzbi+32s5GXQsbz3k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053