UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f2+fnvtFCZD5sU6IXDI+IqS6OARbUgZpbOtdB7eeoIo='
WHERE
key_id = '8d06713df2283e55519a5814659ad966cbfbc8cece524987811dcf94488f88b7'
AND (
token = 'f2+fnvtFCZD5sU6IXDI+IqS6OARbUgZpbOtdB7eeoIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)