UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WJBcWGUtCZpvtdfj6VSn/Nv+JjIclV4S9Q9NwUqJ/Bk='
WHERE
key_id = '0017aca589cfaf7d77cead5c811a4eb390ca3c28167a5d3ef9ce5e771b35df57'
AND (
token = 'WJBcWGUtCZpvtdfj6VSn/Nv+JjIclV4S9Q9NwUqJ/Bk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)