UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OmI1ydsrqeaFezc1g8VtV9fflQsl9otMpw5JS8VDqgI='
WHERE
key_id = '98b1f7c1e4a7e041b0bb72f24cdf3d2d973da46adf94a3c52d725c6c62056f13'
AND (
token = 'OmI1ydsrqeaFezc1g8VtV9fflQsl9otMpw5JS8VDqgI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)