UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3apo5QW+5prLYdL4dBeLAyD+VN051OpzRpsiR0upWA0='
WHERE
key_id = 'a84702bb7fb74581d22957ab4242137f0811f4c03af51854ccbd496893fa60be'
AND (
token = '3apo5QW+5prLYdL4dBeLAyD+VN051OpzRpsiR0upWA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)