UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5PC1INqgedb99HlhDpYuJ1icYuV4Xv4GhIPUiwHEkZg='
WHERE
key_id = '76985cfe2c6e5b70c37e1c0f7233cade660953e007b9b24dc3c23e7b96631bad'
AND (
token = '5PC1INqgedb99HlhDpYuJ1icYuV4Xv4GhIPUiwHEkZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)