UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rp7DSRXkdVeGx5K+rZOmaYaa+niSP82ufmOU57Fay/k='
WHERE
key_id = 'b3c452f39c35b907e5c99beac622c200c3f277d8d69924f2afb80733ee2108b3'
AND (
token = 'rp7DSRXkdVeGx5K+rZOmaYaa+niSP82ufmOU57Fay/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)