UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wrNee2DV+d3+uibaofQwMbt1OVaYWRHJf2j3y7tJNRE='
WHERE
key_id = 'ddb0cbd4b05d2808d23264ff2fcce3c93d290b468d89c053cdf4b1ffeab3fedc'
AND (
token = 'wrNee2DV+d3+uibaofQwMbt1OVaYWRHJf2j3y7tJNRE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)