UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ALsV+4NaP7G4W8Fs5Q90g7r+XV8F5VXHLLJ8Lwnh+aU='
WHERE
key_id = 'ad45f8a213eb70cf9c761c80b675a2d9c4b6dc43e4837bbae7ea24890e25da29'
AND (
token = 'ALsV+4NaP7G4W8Fs5Q90g7r+XV8F5VXHLLJ8Lwnh+aU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)