UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cyVCwFzuxMJHz/g7mQd/lxMXaTKnH8nrlCLPu2++bmY='
WHERE
key_id = 'e37208ad9ab776797d17212fd28c794e47e0c457146abbee3395ae85d0f5a810'
AND (
token = 'cyVCwFzuxMJHz/g7mQd/lxMXaTKnH8nrlCLPu2++bmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)