UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D+zqQj9zopw7wJYDXFP6yYP10jnwFYf0xUPsyGcGm7s='
WHERE
key_id = 'fb805627406c57c4cfe2a0880a8dfc2d555b9dbd8ac6abdd20aa4b722415cee0'
AND (
token = 'D+zqQj9zopw7wJYDXFP6yYP10jnwFYf0xUPsyGcGm7s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)