UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jBzDQsbOUlEFnsq3v/LuiAoFUtOvzm/PrlBs+39Zeh4='
WHERE
key_id = 'c3a76f8130b5d7ef8e2632b3f01d135a1f844e7777deffcdcce544f40326ed28'
AND (
token = 'jBzDQsbOUlEFnsq3v/LuiAoFUtOvzm/PrlBs+39Zeh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)