UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gh1zfA81UXyO5j+IyyBtkgK7X1UQX8XZiqeiN87xbgg='
WHERE
key_id = '68b0b3156feec163e5be97aef90957c819ca6db883e30373ebafe8304c0a87c8'
AND (
token = 'gh1zfA81UXyO5j+IyyBtkgK7X1UQX8XZiqeiN87xbgg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)