UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UelQGjhs4BHw9cRgA/H20kerHnXwvCxDnXKwISC5f8U='
WHERE
key_id = '34b1c74b0b696be44c9c1fcdcff6fb86bb79b2cc791d915785b6c45d266ba0a4'
AND (
token = 'UelQGjhs4BHw9cRgA/H20kerHnXwvCxDnXKwISC5f8U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)