UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JLnnMVd5L6faejZyg8aRaWHVMPSdjxIkrOEMpCHiCK0='
WHERE
key_id = 'eb6957c89e9252fcc2d0c15309e5bc3ad71f5f7c9d09bbaad4cb0e873e87f09d'
AND (
token = 'JLnnMVd5L6faejZyg8aRaWHVMPSdjxIkrOEMpCHiCK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)