UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A9y5vkJ1FmHMam/Bd6QGHUh6EQP0EMQA12hvhmPuvXk='
WHERE
key_id = 'ded5d15d277b4488bb22e9ddcfed7b34940992b0b143fbf62457e7b55e12f30d'
AND (
token = 'A9y5vkJ1FmHMam/Bd6QGHUh6EQP0EMQA12hvhmPuvXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)