UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y5Bi0Eecd5j8T63FUfPP3dk7aGNGOJERRZeTOAwbMc0='
WHERE
key_id = '82d09ed391ecb68dd73aaa9d30cac51e1b83af4ee414f51efa8531e0a6d87e60'
AND (
token = 'Y5Bi0Eecd5j8T63FUfPP3dk7aGNGOJERRZeTOAwbMc0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)