UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's1GvFY7wJmglYnWjxwIPdaunqF5k8UMV+P8jPF2TYiw='
WHERE
key_id = 'd99533caacd0d37098908fa209599052380fdfb2beeafaf556e96a6708f52cc8'
AND (
token = 's1GvFY7wJmglYnWjxwIPdaunqF5k8UMV+P8jPF2TYiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)