UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/f95Ko/b0Zsza66HO9Tff2yzNmzxGWMKLVBbbdGmYPM='
WHERE
key_id = '1071b853720c62efe1c71b3bf5473a14553e9113f70877170179f337f7d09476'
AND (
token = '/f95Ko/b0Zsza66HO9Tff2yzNmzxGWMKLVBbbdGmYPM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)