UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KqAXKOr0ZFwtpv9ZtSe7jx3dDPvP9XkUCqOg+1O/184='
WHERE
key_id = 'c31cf2d6cd976d546a8b56ce3121883a569f42de1a4f2b35501e8c8ad61a9af4'
AND (
token = 'KqAXKOr0ZFwtpv9ZtSe7jx3dDPvP9XkUCqOg+1O/184='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)