UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rxTd216n9X14sp8Zrj4nLKA8n285/tBG6gr3MEFnTQE='
WHERE
key_id = 'f36586d5746d32d6688067f621a710d0ab3473961650d771bfed6440243a5730'
AND (
token = 'rxTd216n9X14sp8Zrj4nLKA8n285/tBG6gr3MEFnTQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)