UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vygz9kdcR2prv9udVp7SH6294lFm+r/BXU69fk/xVZA='
WHERE
key_id = '1f953236aed4e629615e0bdb76445d021b692fa70e0a9c23e98de0162dd417fe'
AND (
token = 'Vygz9kdcR2prv9udVp7SH6294lFm+r/BXU69fk/xVZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)