UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OPcBFrVUlolkajm+j5QaWBElPOpJM31LeW8ZXst/9xc='
WHERE
key_id = 'c8acb4544429ca8e368510da9c09fe007cb43e5d3a6f3f1f1d3a1151291192af'
AND (
token = 'OPcBFrVUlolkajm+j5QaWBElPOpJM31LeW8ZXst/9xc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)