UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pGO8vO5Z4TPfg/TRmeHuqhuNXbWT/He7/h7ozSjsCu0='
WHERE
key_id = 'd2283aff45eded0a30bd51e1b53b28ca532b4880f52ae17b16ea995415bc3f7f'
AND (
token = 'pGO8vO5Z4TPfg/TRmeHuqhuNXbWT/He7/h7ozSjsCu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)