UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DKRHGFpPMCCoE3A6Nv7oN+yGaRLYrcKsyW9qShKv4/8='
WHERE
key_id = '5f564a86166fdfe7161f3f4258836d6cfbd23d4ed99465e7860d93ff2b690e07'
AND (
token = 'DKRHGFpPMCCoE3A6Nv7oN+yGaRLYrcKsyW9qShKv4/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)