UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7xHy15cPNaVNxY1wUvUkxdr4ZruTV9U47H5YTbbnHr0='
WHERE
key_id = '490d98f7f5f04d0aa8a1185ee3fd4338da7175695d6d4e8080f6cf5570d518cb'
AND (
token = '7xHy15cPNaVNxY1wUvUkxdr4ZruTV9U47H5YTbbnHr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)