UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9feSeatrV5GCEVuhrB/n75uHT3gnlojgvp0aOGi4Ez8='
WHERE
key_id = '441df145e2b231494004ddc783ee614165c5299c1d5ce6af302727f479aa97bf'
AND (
token = '9feSeatrV5GCEVuhrB/n75uHT3gnlojgvp0aOGi4Ez8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)